package com.controller.minidm;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.controller.lib.BootRequestService;
import com.controller.lib.DmSdk;
import com.controller.lib.OnCustomDirectiveListener;
import com.controller.lib.OnDownLoadCompleteListener;
import com.controller.lib.activity.PlayerViewActivity;
import org.jetbrains.annotations.NotNull;


/**
 * @author Peak.Qi
 * @version 1.0
 * @since 2019-11-23 16:28
 */
public class MainActivity extends AppCompatActivity {

  @Override
  protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    //Intent intent=new Intent();
    //intent.setClass(this, BootRequestService.class);
    //startService(intent);

    //Intent intent = new Intent(this, PlayerViewActivity.class);
    //intent.putExtra("video_url", "http://vjs.zencdn.net/v/oceans.mp4");
    //Intent intent = new Intent(this, WallpaperImageActivity.class);
    //intent.putExtra("image_url", "https://pic1.arkoo.com/56D0B40F99F841DF8A2425762AE2565D/picture/o_1i4qop009177v1tgf14db15he1iaj1is.jpg");
    //startActivity(intent);


    DmSdk.INSTANCE.setCustomDirectiveListener(new OnCustomDirectiveListener() {
      @Override public void onRestartDevice(@NonNull String command) {
        Log.d("gerui" ,"onRestartDevice: " + command);
      }

      @Override public void onShutDownDevice(@NonNull String command) {
         Log.d("gerui" ,"onShutDownDevice: " + command);
      }

      @Override public void onCustomDirective(@NotNull String command) {
         Log.d("gerui" ,"onCustomDirective: " + command);
      }
    });
    DmSdk.INSTANCE.setOnDownLoadCompleteListener(new OnDownLoadCompleteListener() {

      @Override public void onFile(@NonNull String filePath) {
        Log.d("gerui" ,"onFile: " + filePath);
      }

      @Override public void onVideo(@NonNull String filePath) {
          Log.d("gerui" ,"onVideo: " + filePath);
      }

      @Override public void onPicture(@NonNull String pictureUri) {
         Log.d("gerui" ,"onPicture: " + pictureUri);
      }
    });
  }
}
